/*
 * Copyright (c) 2017, salesforce.com, inc.
 * All rights reserved.
 * Licensed under the BSD 3-Clause license.
 * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
 */

export const SFDX_PROJECT_FILE = 'sfdx-project.json';
export const ENV_SF_DISABLE_TELEMETRY = 'SF_DISABLE_TELEMETRY';
export const PKG_ID_PREFIX = '04t';

export const TELEMETRY_GLOBAL_VALUE = 'sfdxTelemetryMessage';
export const TELEMETRY_OPT_OUT_LINK = 'https://developer.salesforce.com/tools/vscode/en/faq/telemetry';
export const TELEMETRY_INTERNAL_VALUE = 'sfdxTelemetryMessageInternal';
export const TELEMETRY_METADATA_COUNT = 'metadataCount';
export const BASE_EXTENSION = 'salesforce.salesforcedx-vscode';
export const EXPANDED_EXTENSION = 'salesforce.salesforcedx-vscode-expanded';
export const EXT_PACK_STATUS_EVENT_NAME = 'extensionPackStatus';

// sfdxCore setting config values
export const ALL_EXCEPTION_CATCHER_ENABLED = 'allExceptionCatcherEnabled';
export const CONFLICT_DETECTION_ENABLED = 'detectConflictsForDeployAndRetrieve';
export const INTERNAL_DEVELOPMENT_FLAG = 'internal-development';
export const PUSH_OR_DEPLOY_ON_SAVE_ENABLED = 'push-or-deploy-on-save.enabled';
export const PREFER_DEPLOY_ON_SAVE_ENABLED = 'push-or-deploy-on-save.preferDeployOnSave';
export const PUSH_OR_DEPLOY_ON_SAVE_IGNORE_CONFLICTS = 'push-or-deploy-on-save.ignoreConflictsOnPush';
export const DEPLOY_ON_SAVE_SHOW_OUTPUT_PANEL = 'push-or-deploy-on-save.showOutputPanel';
export const RETRIEVE_TEST_CODE_COVERAGE = 'retrieve-test-code-coverage';
export const SHOW_CLI_SUCCESS_INFO_MSG = 'show-cli-success-msg';
export const TELEMETRY_ENABLED = 'telemetry.enabled';
export const ENABLE_SOBJECT_REFRESH_ON_STARTUP = 'enable-sobject-refresh-on-startup';
export const ENABLE_SOURCE_TRACKING_FOR_DEPLOY_RETRIEVE = 'experimental.enableSourceTrackingForDeployAndRetrieve';
export const ENV_NODE_EXTRA_CA_CERTS = 'NODE_EXTRA_CA_CERTS';
export const ENV_SF_LOG_LEVEL = 'SF_LOG_LEVEL';
export const USE_LEGACY_ORG_BROWSER = 'useLegacyOrgBrowser';

export const APEX_FILE_NAME_EXTENSION = '.apex';
export const SOQL_FILE_NAME_EXTENSION = '.soql';
export const AURA_PATH = '/force-app/main/default/aura/';
export const APEX_CLASSES_PATH = '/force-app/main/default/classes/';
export const LWC_PATH = '/force-app/main/default/lwc/';
export const FUNCTIONS_PATH = '/functions/';

// Commands
export const PROJECT_RETRIEVE_START_LOG_NAME = 'project_retrieve_start_default_scratch_org';
export const PROJECT_DEPLOY_START_LOG_NAME = 'project_deploy_start_default_scratch_org';

/**
 * Valid Salesforce metadata types extracted from salesforce_metadata_api_clean.xsd
 */
export const VALID_METADATA_TYPES = new Set([
  'AIApplication',
  'AIApplicationConfig',
  'AIReplyRecommendationsSettings',
  'AIScoringModelDefinition',
  'AIUsecaseDefinition',
  'AccountInsightsSettings',
  'AccountIntelligenceSettings',
  'AccountPlanObjMeasCalcDef',
  'AccountPlanSettings',
  'AccountRelationshipShareRule',
  'AccountSettings',
  'AccountingFieldMapping',
  'AccountingModelConfig',
  'AccountingSettings',
  'ActionLinkGroupTemplate',
  'ActionOverride',
  'ActionPlanTemplate',
  'ActionsSettings',
  'ActivationPlatform',
  'ActivationPlatformActvAttr',
  'ActivationPlatformField',
  'ActivitiesSettings',
  'ActvPfrmDataConnectorS3',
  'ActvPlatformAdncIdentifier',
  'ActvPlatformFieldValue',
  'AddressSettings',
  'AdvAccountForecastSet',
  'AgentforceForDevelopersSettings',
  'AiPluginUtteranceDef',
  'AnalyticSnapshot',
  'AnalyticsDashboard',
  'AnalyticsSettings',
  'AnalyticsVisualization',
  'AnalyticsWorkspace',
  'AnimationRule',
  'ApexClass',
  'ApexComponent',
  'ApexEmailNotifications',
  'ApexPage',
  'ApexSettings',
  'ApexTestSuite',
  'ApexTrigger',
  'AppAnalyticsSettings',
  'AppExperienceSettings',
  'AppFrameworkTemplateBundle',
  'AppMenu',
  'ApplicationSubtypeDefinition',
  'AppointmentAssignmentPolicy',
  'AppointmentSchedulingPolicy',
  'ApprovalProcess',
  'ArticleType',
  'ArticleType_CustomField',
  'ArticleType_Layout',
  'AssessmentQuestion',
  'AssessmentQuestionSet',
  'AssignmentRules',
  'AssociationEngineSettings',
  'Audience',
  'AuraDefinitionBundle',
  'AuthProvider',
  'AutoResponseRules',
  'AutomatedContactsSettings',
  'BaseSharingRule',
  'BatchCalcJobDefinition',
  'BatchProcessJobDefinition',
  'BenefitAction',
  'BlacklistedConsumer',
  'Bot',
  'BotBlock',
  'BotSettings',
  'BotTemplate',
  'BotVersion',
  'BranchManagementSettings',
  'BrandingSet',
  'BriefcaseDefinition',
  'BusinessHoursSettings',
  'BusinessProcess',
  'BusinessProcessGroup',
  'BusinessProcessTypeDefinition',
  'CMSConnectSource',
  'CallCenter',
  'CallCenterRoutingMap',
  'CallCoachingMediaProvider',
  'CampaignInfluenceModel',
  'CampaignSettings',
  'CareBenefitVerifySettings',
  'CareLimitType',
  'CareProviderSearchConfig',
  'CareRequestConfiguration',
  'CaseSettings',
  'CaseSubjectParticle',
  'Certificate',
  'ChannelLayout',
  'ChannelObjectLinkingRule',
  'ChatterAnswersSettings',
  'ChatterEmailsMDSettings',
  'ChatterExtension',
  'ChatterSettings',
  'ChoiceList',
  'CleanDataService',
  'CodeBuilderSettings',
  'CollectionsDashboardSettings',
  'CommerceSettings',
  'CommunitiesSettings',
  'CommunityTemplateDefinition',
  'CommunityThemeDefinition',
  'Community_Zone',
  'CompactLayout',
  'CompanySettings',
  'ConnectedApp',
  'ConnectedAppSettings',
  'ConnectedSystem',
  'ContentAsset',
  'ContentSettings',
  'ContentTypeBundle',
  'ContextDefinition',
  'ContractSettings',
  'ContractType',
  'ConvIntelligenceSignalRule',
  'ConversationChannelDefinition',
  'ConversationMessageDefinition',
  'ConversationVendorInfo',
  'ConversationalIntelligenceSettings',
  'CorsWhitelistOrigin',
  'CriteriaBasedSharingRule',
  'CspTrustedSite',
  'CurrencySettings',
  'CustomAddressFieldSettings',
  'CustomApplication',
  'CustomApplicationComponent',
  'CustomFeedFilter',
  'CustomField',
  'CustomFieldDisplay',
  'CustomHelpMenuSection',
  'CustomIndex',
  'CustomLabels',
  'CustomMetadata',
  'CustomNotificationType',
  'CustomObject',
  'CustomObjectTranslation',
  'CustomPageWebLink',
  'CustomPermission',
  'CustomSite',
  'CustomTab',
  'CustomValue',
  'Custom_Metadata_Types_CustomObject',
  'CustomerDataPlatformSettings',
  'Dashboard',
  'DataCategoryGroup',
  'DataConnector',
  'DataConnectorIngestApi',
  'DataConnectorS3',
  'DataDotComSettings',
  'DataImportManagementSettings',
  'DataMapping',
  'DataMappingFieldDefinition',
  'DataMappingObjectDefinition',
  'DataMappingSchema',
  'DataObjectSearchIndexConf',
  'DataPackageKitDefinition',
  'DataPackageKitObject',
  'DataSource',
  'DataSourceBundleDefinition',
  'DataSourceField',
  'DataSourceObject',
  'DataSourceTenant',
  'DataSrcDataModelFieldMap',
  'DataStreamDefinition',
  'DataStreamTemplate',
  'DataWeaveResource',
  'Data_Cloud_Metadata_Types',
  'DecisionMatrixDefinition',
  'DecisionTable',
  'DecisionTableDatasetLink',
  'DelegateGroup',
  'DeploymentSettings',
  'DevHubSettings',
  'DigitalExperienceBundle',
  'DigitalExperienceBundle_Marketing_Workspace_Bundle_and_Folders',
  'DigitalExperienceBundle_Site_Workspace_Bundle_and_Folders',
  'DigitalExperienceConfig',
  'DiscoveryAIModel',
  'DiscoveryGoal',
  'DiscoveryStory',
  'Document',
  'DocumentCategory',
  'DocumentCategoryDocumentType',
  'DocumentChecklistSettings',
  'DocumentGenerationSetting',
  'DocumentType',
  'DuplicateRule',
  'DynamicFormsSettings',
  'EACSettings',
  'ESignatureConfig',
  'ESignatureEnvelopeConfig',
  'EclairGeoData',
  'EinsteinAgentSettings',
  'EinsteinGptSettings',
  'EmailAdministrationSettings',
  'EmailIntegrationSettings',
  'EmailServicesFunction',
  'EmailTemplate',
  'EmailTemplateSettings',
  'EmbeddedServiceBranding',
  'EmbeddedServiceConfig',
  'EmbeddedServiceFieldService',
  'EmbeddedServiceFlowConfig',
  'EmbeddedServiceLiveAgent',
  'EmbeddedServiceMenuSettings',
  'EmployeeUserSettings',
  'EnablementMeasureDefinition',
  'EnablementProgramDefinition',
  'EnblProgramTaskSubCategory',
  'EncryptionKeySettings',
  'EnhancedNotesSettings',
  'EntitlementProcess',
  'EntitlementSettings',
  'EntitlementTemplate',
  'EscalationRules',
  'EventDelivery',
  'EventRelayConfig',
  'EventSettings',
  'EventSubscription',
  'ExperienceBundle',
  'ExperienceBundleSettings',
  'ExperiencePropertyTypeBundle_Beta',
  'ExplainabilityActionDefinition',
  'ExplainabilityActionVersion',
  'ExplainabilityMsgTemplate',
  'ExpressionSetDefinition',
  'ExpressionSetMessageToken',
  'ExpressionSetObjectAlias',
  'ExternalAIModel',
  'ExternalAuthIdentityProvider',
  'ExternalClientAppSettings',
  'ExternalClientApplication',
  'ExternalCredential',
  'ExternalDataConnector',
  'ExternalDataSource',
  'ExternalDataTranObject',
  'ExternalDataTransportFieldTemplate',
  'ExternalDataTransportObjectTemplate',
  'ExternalServiceRegistration',
  'ExternalServicesSettings',
  'ExtlClntAppConfigurablePolicies',
  'ExtlClntAppGlobalOauthSettings',
  'ExtlClntAppMobileConfigurablePolicies',
  'ExtlClntAppMobileSettings',
  'ExtlClntAppNotificationSettings',
  'ExtlClntAppOauthConfigurablePolicies',
  'ExtlClntAppOauthSettings',
  'ExtlClntAppPushConfigurablePolicies',
  'ExtlClntAppPushSettings',
  'ExtlClntAppSamlConfigurablePolicies',
  'FeatureParameterBoolean',
  'FeatureParameterDate',
  'FeatureParameterInteger',
  'FederationDataMappingUsage',
  'FieldRestrictionRule',
  'FieldServiceSettings',
  'FieldSet',
  'FieldSrcTrgtRelationship',
  'FileUploadAndDownloadSecuritySettings',
  'FilesConnectSettings',
  'FlexiPage',
  'Flow',
  'FlowCategory',
  'FlowDefinition',
  'FlowSettings',
  'FlowTest',
  'Folder',
  'FolderShare',
  'ForecastingFilter',
  'ForecastingFilterCondition',
  'ForecastingObjectListSettings',
  'ForecastingSettings',
  'ForecastingSourceDefinition',
  'ForecastingType',
  'ForecastingTypeSource',
  'FuelType',
  'FuelTypeSustnUom',
  'FunctionReference',
  'FundraisingConfig',
  'GatewayProviderPaymentMethodType',
  'GenAiFunction',
  'GenAiPlanner',
  'GenAiPlannerBundle',
  'GenAiPlugin',
  'GenAiPluginInstructionDef',
  'GenAiPromptTemplate',
  'GenAiPromptTemplateActv',
  'GlobalPicklist',
  'GlobalPicklistValue',
  'GlobalValueSet',
  'GlobalValueSetTranslation',
  'GoogleAppsSettings',
  'Group',
  'HighVelocitySalesSettings',
  'HistoryRetentionPolicy',
  'HomePageComponent',
  'HomePageLayout',
  'IPAddressRange',
  'IdeasSettings',
  'IdentityProviderSettings',
  'IdentityVerificationProcDef',
  'IdentityVerificationProcDtl',
  'IdentityVerificationProcFld',
  'IframeWhiteListUrlSettings',
  'InboundCertificate',
  'InboundNetworkConnection',
  'IncidentMgmtSettings',
  'Index',
  'IndustriesSettings',
  'IndustriesUnifiedInventorySettings',
  'InstalledPackage',
  'IntegrationProviderDef',
  'InterestTaggingSettings',
  'InternalDataConnector',
  'InvLatePymntRiskCalcSettings',
  'InventorySettings',
  'InvocableActionExtension',
  'InvocableActionSettings',
  'KeywordList',
  'KnowledgeSettings',
  'LanguageSettings',
  'Layout',
  'LeadConfigSettings',
  'LeadConvertSettings',
  'LearningItemType',
  'Letterhead',
  'LightningBolt',
  'LightningComponentBundle',
  'LightningExperienceSettings',
  'LightningExperienceTheme',
  'LightningMessageChannel',
  'LightningOnboardingConfig',
  'LightningOutApp',
  'LightningTypeBundle',
  'ListView',
  'LiveAgentSettings',
  'LiveChatAgentConfig',
  'LiveChatButton',
  'LiveChatDeployment',
  'LiveChatSensitiveDataRule',
  'LiveMessageSettings',
  'LoyaltyProgramSetup',
  'MLDataDefinition',
  'MLPredictionDefinition',
  'MLRecommendationDefinition',
  'MacroSettings',
  'MailMergeSettings',
  'ManagedContentType',
  'ManagedEventSubscription_Beta',
  'ManagedTopics',
  'MapAndLocationSettings',
  'MarketSegmentDefinition',
  'MarketingAppExtension',
  'MatchingRule',
  'MeetingsSettings',
  'MessagingChannel',
  'Metadata',
  'MetadataWithContent',
  'Metadata_Components_and_Types',
  'Metadata_Field_Types',
  'Metadata_Types',
  'MfgProgramTemplate',
  'MilestoneType',
  'MktCalcInsightObjectDef',
  'MktDataTranObject',
  'MlDomain',
  'MobSecurityCertPinConfig',
  'MobileApplicationDetail',
  'MobileSecurityAssignment',
  'MobileSecurityPolicy',
  'MobileSettings',
  'ModerationRule',
  'MutingPermissionSet',
  'MyDomainDiscoverableLogin',
  'MyDomainSettings',
  'NameSettings',
  'NamedCredential',
  'NamedFilter',
  'NavigationMenu',
  'Network',
  'NetworkBranding',
  'NotificationTypeConfig',
  'NotificationsSettings',
  'OauthCustomScope',
  'OauthOidcSettings',
  'OauthTokenExchangeHandler',
  'ObjectLinkingSettings_Beta',
  'ObjectSourceTargetMap',
  'OcrSampleDocument',
  'OcrTemplate',
  'OmniChannelSettings',
  'OmniExtTrackingDef',
  'OmniInteractionAccessConfig',
  'OmniInteractionConfig',
  'OmniScript',
  'OmniSupervisorConfig',
  'OmniTrackingGroup',
  'OpportunityInsightsSettings',
  'OpportunityScoreSettings',
  'OpportunitySettings',
  'OrderManagementSettings',
  'OrderSettings',
  'OrgPreferenceSettings',
  'OrgSettings',
  'OutboundNetworkConnection',
  'OwnerSharingRule',
  'Package',
  'PardotEinsteinSettings',
  'PardotSettings',
  'PartyDataModelSettings',
  'PathAssistant',
  'PathAssistantSettings',
  'PaymentGatewayProvider',
  'PaymentsSettings',
  'PermissionSet',
  'PermissionSetGroup',
  'PermissionSetLicenseDefinition_Developer_Preview',
  'PersonAccountOwnerPowerUser',
  'PicklistSettings',
  'Picklist_Including_Dependent_Picklist',
  'PipelineInspMetricConfig',
  'PlatformCachePartition',
  'PlatformEncryptionSettings',
  'PlatformEventChannel',
  'PlatformEventChannelMember',
  'PlatformEventSettings',
  'PlatformEventSubscriberConfig',
  'Portal',
  'PortalDelegablePermissionSet',
  'PostTemplate',
  'PredictionBuilderSettings',
  'PresenceDeclineReason',
  'PresenceUserConfig',
  'PrivacySettings',
  'ProcessFlowMigration',
  'ProductAttributeSet',
  'ProductSettings',
  'Profile',
  'ProfileActionOverride',
  'ProfilePasswordPolicy',
  'ProfileSearchLayouts',
  'ProfileSessionSetting',
  'Prompt',
  'PublicKeyCertificate',
  'PublicKeyCertificateSet',
  'Queue',
  'QueueRoutingConfig',
  'QuickAction',
  'QuoteSettings',
  'RealTimeEventSettings',
  'RecommendationStrategy',
  'RecordActionDeployment',
  'RecordPageSettings',
  'RecordType',
  'RedirectWhitelistUrl',
  'ReferencedDashboard',
  'RegisteredExternalService',
  'RelatedRecordAssocCriteria',
  'RelationshipGraphDefinition',
  'RemoteSiteSetting',
  'Report',
  'ReportType',
  'RestrictionRule',
  'Role',
  'RoleOrTerritory',
  'SalesWorkQueueSettings',
  'SamlSsoConfig',
  'SandboxSettings',
  'SchedulingObjective',
  'SchedulingRule',
  'SchemaSettings',
  'Scontrol',
  'SearchCustomization',
  'SearchLayouts',
  'SearchOrgWideObjectConfig',
  'SearchSettings',
  'SecuritySettings',
  'ServiceAISetupDefinition',
  'ServiceAISetupField',
  'ServiceChannel',
  'ServiceCloudVoiceSettings',
  'ServicePresenceStatus',
  'ServiceProcess',
  'ServiceSetupAssistantSettings',
  'Settings',
  'SharedTo',
  'SharingBaseRule',
  'SharingReason',
  'SharingRecalculation',
  'SharingRules',
  'SharingSet',
  'SharingSettings',
  'SiteDotCom',
  'SiteSettings',
  'Skill',
  'SocialCustomerServiceSettings',
  'SocialProfileSettings',
  'SourceTrackingSettings_Beta',
  'StandardValueSet',
  'StandardValueSetTranslation',
  'StaticResource',
  'StreamingAppDataConnector',
  'SubscriptionManagementSettings',
  'SurveySettings',
  'SustainabilityUom',
  'SustnUomConversion',
  'SvcCatalogCategory',
  'SvcCatalogFulfillmentFlow',
  'SvcCatalogItemDef',
  'SynonymDictionary',
  'Territory',
  'Territory2',
  'Territory2Model',
  'Territory2Rule',
  'Territory2Settings',
  'Territory2Type',
  'TimeSheetTemplate',
  'TimelineObjectDefinition',
  'TopicsForObjects',
  'TrailheadSettings',
  'TransactionSecurityPolicy',
  'Translations',
  'TrialOrgSettings',
  'UIObjectRelationConfig',
  'UiFormatSpecificationSet',
  'Unsupported_Metadata_Types',
  'UserAccessPolicy',
  'UserAuthCertificate',
  'UserCriteria',
  'UserEngagementSettings',
  'UserInterfaceSettings',
  'UserManagementSettings',
  'UserProfileSearchScope',
  'UserProvisioningConfig',
  'ValidationRule',
  'VirtualVisitConfig',
  'VoiceSettings',
  'WaveAnalyticAssetCollection',
  'WaveApplication',
  'WaveComponent',
  'WaveDashboard',
  'WaveDataflow',
  'WaveDataset',
  'WaveLens',
  'WaveRecipe',
  'WaveTemplateBundle',
  'WaveXmd',
  'WebLink',
  'WebStoreBundle',
  'WebStoreTemplate',
  'WorkDotComSettings',
  'WorkSkillRouting',
  'Workflow',
  'WorkforceEngagementSettings',
  // Additional types for test compatibility (may be sub-types or versions)
  'PromptVersion'
]);
